<?php
namespace App\Http\Controllers\Backend;

use App\Servers\Backend\ComboServer;
use Illuminate\Http\Request;

class ComboController extends CommonController
{

    public function __construct(ComboServer $comboServer)
    {
        parent::__construct();
        $this->server = $comboServer;
    }

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $input = json_decode($request->input('data'), true);
        $result = $this->server->index($input);
        return $this->responseResult($result);
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create(Request $request)
    {
        $input = $request->toArray();
        $result = $this->server->create($input['data']);
        return $this->responseResult($result);
    }

    public function destroy(Request $request)
    {
        $input = $request->toArray();
        $result = $this->server->destroy($input['data']);
        return $this->responseResult($result);
    }



}